fix: use consistent rlp encoding for KeyAuthorization#40
Closed
fix: use consistent rlp encoding for KeyAuthorization#40
Conversation
Co-authored-by: Arsenii Kulikov <62447812+klkvr@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d4f6f-abd8-73c6-8b2e-e785405a884a
decofe
added a commit
that referenced
this pull request
Apr 3, 2026
- Sync base ABI from tempo-std via tempo_abis.sh --sync - Add T3 authorizeKey overload + new T3 functions on top (tempo-std not yet updated for T3) - Resolve cherry-pick conflict with PR #40 RLP fix (expiry=0 handling already in as_rlp_payload) - Fix test_inline_key_auth_with_limits: pass SignedKeyAuthorization object instead of raw bytes Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
grandizzy
added a commit
that referenced
this pull request
Apr 7, 2026
* feat: add TIP-1011 authorizeKey with KeyRestrictions (T3+) Add the new authorizeKey(address,uint8,KeyRestrictions) ABI entry and the CallScope/KeyRestrictions types to IAccountKeychain.json. Rename the existing authorize_key() to authorize_key_legacy() (pre-T3) and make authorize_key() use the T3+ KeyRestrictions struct with allow_any_calls and allowed_calls params. Co-Authored-By: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com> * chore: add changelog * fix: use CallScope type for allowed_calls, export from top-level Co-Authored-By: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com> * fix: validate CallScope selector length, document TIP20-only restriction Co-Authored-By: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com> * feat: harden keychain type system * fix: align ABI with current IAccountKeychain interface - TokenLimit: add period (uint64) field for T3+ overload - CallScope: use SelectorRule[] instead of flat bytes4 - Add missing functions: setAllowedCalls, removeAllowedCalls, getRemainingLimitWithPeriod, getAllowedCalls - Add AccessKeySpend event - Fix ruff lint warnings (UP045/UP037) Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com> * fix: sync ABI from tempo-std, fix RLP conflicts, fix integration test - Sync base ABI from tempo-std via tempo_abis.sh --sync - Add T3 authorizeKey overload + new T3 functions on top (tempo-std not yet updated for T3) - Resolve cherry-pick conflict with PR #40 RLP fix (expiry=0 handling already in as_rlp_payload) - Fix test_inline_key_auth_with_limits: pass SignedKeyAuthorization object instead of raw bytes Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com> * fix: gate authorizeKey test on T3 hardfork detection The test calls authorize_key() which defaults to T3 ABI. On pre-T3 nodes (testnet/devnet nightly), the T3 selector is rejected. Detect hardfork and pass legacy=True on T2 nodes. Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com> * fix: detect T3 by probing precompile selector instead of genesis config The previous approach queried eth_getBlockByNumber for t3Time but that field is in the chain config, not block data. Instead, probe the AccountKeychain precompile with the T3 authorizeKey selector (0x980a6025) and check if it returns UnknownFunctionSelector. Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com> * fix: use TEMPO_HARDFORK env var instead of probing precompile Read TEMPO_HARDFORK (default T3), use is_t2 fixture to gate legacy ABI. Pass TEMPO_HARDFORK=T2 in testnet CI workflow. Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com> * fix: bump changelog to major for breaking API change Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d6690-d702-750b-9b66-34568bdf245d * chore: sync IAccountKeychain ABI with tempo-std T3 changes Co-Authored-By: georgen <129292+georgen@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d66a3-f741-70eb-bda2-125c37eab1f5 --------- Co-authored-by: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: 0xrusowsky <0xrusowsky@proton.me> Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com> Co-authored-by: georgen <129292+georgen@users.noreply.github.com>
onbjerg
approved these changes
Apr 7, 2026
Main already incorporates the RLP encoding fix in as_rlp_payload(), so SignedKeyAuthorization.rlp_encode() delegates to it. Co-Authored-By: Arsenii Kulikov <62447812+klkvr@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Matches the encoding change in tempoxyz/tempo#3443.
expiryis no longer encoded as0x80when trailing (no limits present). Treatsexpiry=0the same asexpiry=None.Prompted by: klkvr